package com.db;

import java.sql.DriverManager;

import com.mysql.jdbc.Connection;

public class CreateConnection {
	public static Connection getCon(){
		  Connection conn = null;
		  String url = "jdbc:mysql://localhost:3306/";
		  String dbName = "dashboard";
		  String driver = "com.mysql.jdbc.Driver";
		  String userName = "root"; 
		  String password = "admin";
		  try {
			  Class.forName(driver).newInstance();
			  conn = (Connection) DriverManager.getConnection(url+dbName,userName,password);
			  
		 } catch (Exception e) {
		  e.printStackTrace();
		  }
		return conn;
	}
}
